#include <stdio.h>

long my_strlen(char *s){
	int count = 0;
#if 0
	int i = 0;
	while('\0' != s[i]){
		count++;
		i++;
	}
#endif

#if 0
	while('\0' != s[count]){
		count++;
	}
#endif

#if 0
	while(0 != s[count]){
		count++;
	}
#endif

#if 0
	while(s[count]){
		count++;
	}
#endif

#if 0
	while(s[count++]);
	// 注意上面的循环结束时 count 是 '\0' 后一位的下标
	count--;
#endif

	return count;
}

int main(int argc, const char *argv[])
{
	char s2[20] = "\0helloworld";
	printf("%ld\n", my_strlen(s2)); // 5

	return 0;
}
